package com.zzl.bonds.ticket.dto.myticket;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.bonds.ticket.entity.TicketDataEntity;
import com.zzl.bonds.ticket.entity.feign.ContractEntity;
import com.zzl.general.common.utils.DoubleSerialize;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author : spp
 * @date : 2022/2/25 15:15
 */
@ApidocModel
@Data
public class MyTicketDetail {
    @ApidocModelProperty(description = "主键")
    private String id;

    @ApidocModelProperty(description = "凭证编号")
    private String ticketNo;

    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "票据原始金额/凭证金额")
    private Double ticketAllAmount;

    private Integer ticketTypeSource;

    @ApidocModelProperty(description = "凭证来源,1:开立签收，2：转让签收")
    private String ticketTypeSourceStr;

    @ApidocModelProperty(description = "开单方id")
    private String openEnterpriseId;
    @ApidocModelProperty(description = "开单方企业名称")
    private String openEnterpriseName;
    @ApidocModelProperty(description = "开单方企业社会统一代码")
    private String openCreditCode;

    @ApidocModelProperty(description = "转让方id")
    private String transferEnterpriseId;
    @ApidocModelProperty(description = "转让方企业名称")
    private String transferEnterpriseName;
    @ApidocModelProperty(description = "转让方企业社会统一代码")
    private String transferCreditCode;

    @ApidocModelProperty(description = "收单企业id")
    private String enterpriseId;
    @ApidocModelProperty(description = "收单企业名称")
    private String enterpriseName;
    @ApidocModelProperty(description = "收单企业社会统一代码")
    private String receiveCreditCode;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "开单日期", validate = "yyyy-MM-dd")
    private Date invoiceTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "转单日期")
    private Date transferTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "到期日期", validate = "yyyy-MM-dd")
    private Date expireTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "兑付日期", validate = "yyyy-MM-dd")
    private Date cashTime;

    @ApidocModelProperty(description = "剩余兑付天数")
    private String surplusCashingDays;

    @ApidocModelProperty(description = "期限")
    private Integer limitDays;

    @ApidocModelProperty(description = "金融机构Id")
    private Integer instinctyId;
    @ApidocModelProperty(description = "金融机构名称")
    private String instinctyName;

    private Integer ticketStatus;

    @ApidocModelProperty(description = "失效原因")
    private String invalidReason;

    @ApidocModelProperty(description = "合同编号")
    private String contractNo;


    @ApidocModelProperty(description = "付息方式")
    private Integer paymentMode;

    @ApidocModelProperty(description = "付息方式")
    private String paymentModeInfo;


    /**
     * 接口补充字段
     */


    @ApidocModelProperty(description = "备注")
    private String remark;

    @ApidocModelProperty(description = "业务类型")
    private String businessType;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApidocModelProperty(description = "业务发生时间", validate = "yyyy-MM-dd HH:mm:ss")
    private Date businessCreateTime;


    @ApidocModelProperty(description = "交易对手")
    private String counterParty;


    /**
     * 不是数据库字段
     */
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "应收账款金额")
    private Double receivableAmount;
    @ApidocModelProperty(description = "票据状态 1、正常持有 2、拆转待复核 3、已被拆转 4、融资待复核 5融资完成 6、到期未兑付 7、已兑付")
    private String ticketStatusStr;


    private Date createTime;

    private String parentId;

    private String parentBusinessId;

    /**
     * 文件信息
     */
    @ApidocModelProperty(description = "发票信息")
    List<TicketDataEntity> invoiceList = new ArrayList<>();
    @ApidocModelProperty(description = "凭证信息")
    List<TicketDataEntity> proofList = new ArrayList<>();
    @ApidocModelProperty(description = "协议信息")
    List<ContractEntity> protocolList = new ArrayList<>();


    private String ticketOriginId;

    /**
     * 母单信息
     */
    @ApidocModelProperty(description = "母单信息")
    private ParentTicketInfo parentTicketInfo;
}
